// 防抖
export const antiShake = (fn, t) => {
    const delay = t || 500
    let timer
    return function() {
      const args = arguments
      if (timer) {
        clearTimeout(timer)
      }
     
      const callNow = !timer
     
      timer = setTimeout(() => {
        timer = null
      }, delay)
     
      if (callNow) fn.apply(this, args)
    }
  }
  